<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>选择结构</title>
	<script>
		
		num1 = 10;
		num2 = 20;
		x = "*";


		if(x=='+'){
			document.write(num1+num2);
		}else if(x=='-'){
			document.write(num1-num2);
		}else if(x=="*"){
			document.write(num1*num2);
		}else if(x=="/"){
			document.write(num1/num2);
		}


		switch (x) {
			case '+':
				document.write(num1+num2);
				break;
			case '-':
				document.write(num1-num2);
				break;
			case '*':
				document.write(num1*num2);
				break;
			case '/':
				document.write(num1/num2);
				break;
		}

	</script>
</head>
<body>
	
</body>
</html>